Client-Side Events

Description

Client-side events in the UX Component that can be used to add custom Javascript.

images/clientsideevents.png
Name
Description
afterAjaxCallbackComplete

Fires after an Ajax callback has completed.

afterClientSideDataCacheAjaxCallback

Fires after the Ajax Callback to fetch data for the Client-side data cache completes.

afterControlBasedOnClientSideDataCacheRefreshed

Fires when the control's Client-side data source has been refreshed.

afterDeleteParentRecord

Fires after the callback to delete the parent record is executed. (i.e. called after the .deleteRecord() method returns its response).

afterFailedLogin

Fires after a failed login attempt.

afterGoogleAddressSelect

The afterGoogleAddressSelect event is called after an address is selected from the Google Address Autocomplete list. The event provides access to the place object. The place object contains information about the address selected by the user. You can use the afterGoogleAddressSelect event to define a custom mapping of data from the place object to controls in the UX Component.

afterGoogleVisualization

Fires after the Google visualization library has loaded (if any Google visualization libraries were requested).

afterLoadFromRepository

Fires after the data in the component has been loaded from the Repository

afterLogin

The afterLogin event can be used to display a message on the screen indicating the (friendly) name of the logged in user.

afterLogout

Fires after the callback that occurs when a user logs out of the application has completed. The afterLogout event does NOT fire if 'LOGOUT DOES FULL PAGE RELOAD' is checked.

afterPopulateFromTable

Fires after a callback to populate the controls in the UX Component with data from one or more tables has been completed.

afterPopulateNewRecord

The afterPopulateNewRecord event fires after the Ajax callback completes when a new record is created.

afterPrepare

Fires after the component is prepared (i.e. after the object's .prepare() method is called).

afterRecordNavigate

Fires after a Data Bound UX Component navigates to a new record (including the new record). This event fires before the callback that retrieves the new record has completed. See 'afterPopulateFromTable' event for additional information.

afterResetForm

Fires after a form has been reset to its original values.

afterRptSectionRowAdd

Fires after the user adds a new row to a Repeating Section. Rows can be added to a repeating section when the user clicks the '+', or add, button at the bottom of the repeating section. This button is added by default when the repeating section is created.

afterRptSectionRowDelete

Fires after the user deletes a row from a Repeating Section.

afterRptSectionRowPrepare

Fires after a row in a Repeating Section is prepared.

afterSaveToRepository

Fires after the data in the component has been saved to the Repository

afterValidate

Fires after all controls in the component, or a single control has been validated.

appCache_cached

Fired after the first cache of the manifest file.

appCache_checking

Checking for an update to manifest file. Always the first event fired in the sequence.

appCache_downloading

An update to the manifest file was found. The browser is fetching resources.

appCache_error

The manifest file returns 404 or 410, the download failed, or the manifest changed while the download was in progress.

appCache_noupdate

Fired after the first download of the cache manifest.

appCache_obsolete

Fired if the manifest file returns a 404 or 410. This results in the application cache being deleted.

appCache_progress

Fired for each resource listed in the manifest file as it is being fetched. You can use this event to show progress as the cache is downloaded. For example, set the innerHTML of a div using this Javascript (which uses the 'loaded' and 'total' properties in the 'event' object passed into the event handler): " + e.event.loaded + 'of' + e.event.total; Notice: Firefox does not expose the .loaded and .total property (as of v29)

appCache_updateready

Fired when the manifest resources have been newly redownloaded.

beforeHTMLReportExport

Fires when a user clicks or a toolbar button to export an HTML report to PDF, Excel, Word or text. You can use this event to put up a custom 'working...' message. To dismiss the custom message you can add code to the 'afterAjaxCallbackComplete' event.

beforeOnTimer

Fires before the onTimer event fires. If false is returned the onTimer event does not fire and the timer is stopped.

beforePrepare

Fires before the component is prepared (i.e. before the object's .prepare() method is called.

beforeRptSectionRowPrepare

Fires before a row in a Repeating Section is prepared.

canAjaxCallback

Fires before an Ajax callback. If the function returns false, the callback will be aborted.

canDeleteParentRecord

Fires before the callback to delete the parent record is executed. (i.e. called when the .deleteRecord() method is called).

canLogin

Fires before the callback that occurs when a user tries to log into the application. If the function returns false, the login is aborted.

canLogout

Fires before the callback that occurs when a user tries to log out of the application. If the function returns false, the logout is aborted. The 'logoutSucceeded' will be true/false.

canRecordNavigate

Fires before a Data Bound UX Component navigates to a new record (including the new record). If the code returns false, then the navigation is cancelled. Typically, your code will check to see if e.isDataDirty and then return false if e.isDataDirty is true.

canResetForm

Fires before a form is reset back to its original values.

canRptSectionRowAdd

Fires when the user tries to add a new row to a Repeating Section. Return false to abort the action.

canRptSectionRowDelete

Fires when the user tries to delete a row from a Repeating Section. Return false to abort the action.

canSubmitDialog

Fires before the component is submitted. If event returns false, the component is not submitted.

localStorageDecryption

Fires after data are read from Local Storage. e.data is passed into the event handler. Your code can decrypt the data and set the e.data property to the decrypted value.

localStorageEncryption

Fires before data are written to Local Storage. e.data is passed into the event handler. Your code can encrypt the data and set the e.data property to the encrypted value. If you encrypt the data here, you must define a corresponding decrypting function in the localStorageDecryption function.

onAjaxCallbackFailed

Fires if an Ajax callback fails to complete (i.e. the server does not send a response).

onAjaxCallbackNotAllowed

Fires when an Ajax callback is not allowed by code in the server-side canAjaxCallback event.

onAjaxCallbackNotAvailable

Fires when an Ajax callback is attempted and the device is not currently online (i.e. connected to the internet). Differs from the 'onAjaxCallbackFailed' event in that 'onAjaxCallbackNotAvailable' fires immediately. The 'onAjaxCallbackFailed' event fires after the callback has timed out.

onBeforeClientSideDataCacheRead

Fires before an item in the Client-side data cache is read.

onBeforePersistControlValuesToLocalStorage

Fires before the value of the controls in the UX are persisted to Local Storage. The purpose of this event is to allow you to capture arbitrary data and store it in local storage with the variable values. Your code can set the 'userData' property in the 'e' object. The value in 'userData' will be available when the 'onRestoreVariablesFromLocalStorage' event is fired. The 'controlName' property is the control that triggered the event.

onConnectionChange

Fires before when the internet connection is lost or recovered. The 'online' parameter is true/false.

onControlBlur

Fires when a control loses focus (i.e. is blurred).

onControlChange

Fires when a control's value is changed.

onControlFocus

Fires when a control gets focus. If the control is in a Repeating Section the controlName parameter is of the form controlName:row

onCordovaReady

Fires when the component is running in a native shell that uses Cordova and the device is ready. This event is deprecated. Use onPhoneGapReady instead.

onDataStateChange

Fires when a data bound control on the component changes state from dirty to clean, or visa versa. Contrast with the onStateChange event.

onFieldValidationError

Fires if there were any field level validation errors after the component was submitted. Returns array of objects. Each object has an 'errorText' and 'control' property.

onImageError

Fires when an image in an element was not found. The e object passed in has an 'element' property.

onInitializeBegin

Fires at the beggining of the component initialization, before any controls have been initialized. Does not fire on subsequent Ajax callbacks.

onInitializeComplete

Fires after the component has been completely initialized and all HTML has been rendered. Does not fire on subsequent Ajax callbacks.

onKeyboard

ANDROID ONLY. Fires when the keyboard comes up or is dismissed. The keyboard state ('up' or 'down' is available in the e.state parameter.

onOrientationChange

Fires when the orientation of a device changes. The 'orientation' parameter is either 'portrait' or 'landscape'.

onPanelActivate

This only applies if the UX is embedded in a Panel Card in a parent UX. The event fires when the Panel Card in which the component is embedded gets focus. IMPORTANT: This event will only fire if the UX was given an EXPLICIT ALIAS when embedded into the parent UX!!

onPersistControlValuesToLocalStorage

Fires when the value of the controls in the UX are persisted to Local Storage. The 'controlName' property is the control that triggered the event. The 'success' property is set to true/false depending on whether the data was successfully saved to Local Storage.

onPhoneGapReady

Fires when the component is running in a native shell that uses Cordova. Fires when the device is ready and Cordova is loaded.

onRenderComplete

Last event to fire when the UX is rendered.

onRestoreComponentStateFromLocalStorage

Fires after the component has been rendered and the component state that was persisted to Local Storage has been restored.

onRestoreVariablesFromLocalStorage

Fires after the component has been rendered and variable values persisted to Local Storage have been restored.

onRptSectionFocus

Fires when a control in a Repeating Section gets focus. (See onRptSectionRowChange event also)

onRptSectionRowChange

Fires when the active row in a Repeating Section changes.

onServerSideEventHandlerError

Fires if there was a server-side error in Xbasic code that handles an event.

onServerSideListSummaryCompute

Fires when the server-side summary values for a List control are computed. The name of the List control for which the event is firing is in the 'listId' parameter.

onSessionTimeoutWarning

Fires when the session timeout warning message is shown. (Only fires if session timeout warning is enabled.)

onSignatureCaptureAccept

Fires when the user clicks the 'Accept' button on the SignatureCapture control to accept a signature.

onSignatureCaptureToggle

Fires when the SignatureCapture control surface is set. The signature capture control has two faces: an 'image' to display the signature and a 'canvas' to capture the signature. The 'surface' parameter is either 'canvas' or 'image'. The 'id' parameter is the id of the signature capture control.

onStateChange

Fires when the component changes state from dirty to clean, or visa versa. Fires when a data bound, or non-data bound control changes state. Contrast with the onDataStateChange event.

onSynchronizeDialog

Fires every time a UX is opened after the UX has been previously opened in a window with component 'caching' enabled.

onTabPaneChanged

Fires when the active pane of a Tab or Accordion object changes. This event is typically used in Genie style Tab objects to set the state of the progress meter showing you where you are in the list of Genie panes.

onTimer

Fires when the timer interval has passed. The timer interval is a property of the UX. It can also be set by the {dialog.object}.onTimerEventStart(interval) method.

onWatchEvent

Fires when a client-side watch event in the UX Component is executed.

onWindowResize

Fires when the browser window is resized.

securityNotAuthenticated event

This event is executed if an Ajax callback returns with a 401 status code.

securityPermissionsDenied Event

This event is executed if an Ajax callback returns with a 403 status code.

webSocketOnMessage

Fires when a web-socket server message is received. The message contents are in the e.message parameter. e.message is a Javascript object with properties that specify the message type, text, etc.. TIP: To see the properties in the e.message object use: alert(JSON.stringify(e.message))

webSocketSendMessage

Fires if an attempt was made to send a message to the web-socket server but the message was not sent.

webSocketServerClose

Fires when the web-socket server is closed.